<!doctype html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>宝贝说</title>
        <base target="_top" />
        <script src="http://a.tbcdn.cn/s/kissy/1.2.0/kissy-min.js"></script>
        <link rel="stylesheet" href="static/css/reset-min.css" />
        <link rel="stylesheet" href="static/css/iframe-min.css" />
    </head>
    <body>
        <div class="page{% if module_width == 950 %} w950{% endif %}">
            <div{% if type == "B" %} class="tmall"{% endif %}>
                {% if itemlist %}
                    {% for item in itemlist %}
                    <div class="item item{{forloop.counter0}}">
                        <div class="wrapper{% if forloop.first %} bitem{% endif %}{% if forloop.last %} ritem{% endif %}{% if forloop.revcounter0 == 1 %} ritem{% endif %}">
                          <a class="link" href="http://say.23201.com/url?url=http://item.taobao.com/item.htm?id={{item.num_iid}}&price={{item.price}}&seller_nick={{item.nick}}">
                                <div class="img"><img src="{{item.pic_url}}{% if forloop.first %}_310x310.jpg{% else %}_160x160.jpg{% endif %}"></div>
                                <div class="price{% if item.has_discount %} has-discount{% endif %}">￥{{item.price_a}}.<span>{{item.price_b}}</span></div>
                                {% if forloop.first or item.volumn > 9 %}
                                <div class="icon"></div>
                                {% else %}
                                    {% if item.has_discount %}
                                <div class="icon icon-sales"></div>
                                    {% else %}
                                        {% if item.time_distance < 10 %}
                                <div class="icon icon-new"></div>
                                        {% else %}
                                        {% endif %}
                                    {% endif %}
                                {% endif %}
                                <div class="arrow"></div>
                            </a>
                            <div class="desc">
                                {% if item.volumn %}
                                <p class="volumn">销量：<a href="http://say.23201.com/url?url=http://item.taobao.com/item.htm?id={{item.num_iid}}&price={{item.price}}&seller_nick={{item.nick}}#deal-record">{{item.volumn}}</a> 件</p>
                                {% endif %}
                                {% if item.rates %}
                                <p class="comment">评价：<a href="http://say.23201.com/url?url=http://item.taobao.com/item.htm?id={{item.num_iid}}&price={{item.price}}&seller_nick={{item.nick}}#reviews">{{item.rates}}</a> 人</p>
                                <ul class="comments">
                                    {% for rate in item.rate_ct %}
                                    <li>{{rate}}</li>
                                    {% endfor %}
                                </ul>
                                {% else %}
                                <p class="title"><a href="http://say.23201.com/url?url=http://item.taobao.com/item.htm?id={{item.num_iid}}&price={{item.price}}&seller_nick={{item.nick}}">{{item.title}}</a></p>
                                {% endif %}
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                {% else %}
                    <p style="position:absolute;left:50%;top:50%;margin-left:-120px;margin-top:-18px;">亲，请先<a href="http://say.23201.com/say/v1/index.html?tracelog=iframe">点此进入应用后台</a>进行设置。<br/>设置后，我们会在本区域展示您的宝贝说智能推荐结果。</p>
                {% endif %}
            </div>
        </div>
        <script>
        KISSY.use("anim",function(S,Anim){
            var D = S.DOM, E = S.Event, doc = document, hoverCls = 'hover';
            S.each(S.query('.item'),function(item){
                var w = D.width(item), h = D.width(item), exw = D.hasClass(item,'item0') ? w+(w-2)/2+2 : w*2+2;
                var anim = new Anim(item,{'width':exw+'px'},0.4);
                E.on(item,'mouseenter',function(e){
                    D.addClass(item,hoverCls);
                    D.width(item,w);
                    anim.run();
                });
                E.on(item,'mouseleave',function(e){
                    D.removeClass(item,hoverCls);
                    anim.stop();
                    D.width(item,w);
                });
            });
        });
        </script>
    </body>
</html>
